﻿<UserControl x:Class="Microsoft.PowerShell.CmdletManagement.ParameterSetGroupingEditor"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Microsoft.PowerShell.CmdletManagement"
    x:Name="root"
    >
    <Grid Margin="5,8,15,5">
        <Grid.RowDefinitions>
          <RowDefinition />
          <RowDefinition />
          <RowDefinition />
        </Grid.RowDefinitions>
        <!--Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions-->
        <RadioButton Name="AllSetRadioButton" Grid.Row="0" Grid.Column="1" IsChecked="True">
            Shared by all parameter sets
        </RadioButton>
        <RadioButton Name="SpecificSetRadioButton" Grid.Row="1" Grid.Column="1" Margin="0,5,0,0">
            Member of specific parameter set
        </RadioButton>
        <StackPanel Grid.Row="2" Grid.Column="1" Margin="10,0,0,0">
            <StackPanel 
                IsEnabled="{Binding ElementName=SpecificSetRadioButton, Path=IsChecked}">
                <ItemsControl x:Name="ParameterSetsList" 
                              ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PsSpecCmdletParametersControl}}, Path=AllParameterSets}"
                              >
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <CheckBox
                                    Name="ParameterSetItem"
                                    Margin="0,5,0,0"
                                    IsChecked="{Binding Path=IsChecked}" 
                                    HorizontalAlignment="Left" 
                                    Content="{Binding Path=ParameterSetName}" />
                            </StackPanel>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <CheckBox Name="NewSet" Click="Click_AddSet" HorizontalAlignment="Left">
                    <StackPanel>
                        <TextBox Name="NewSetName" Width="150" Margin="0,4,0,0" 
                                LostFocus="LostFocus_NewSet" 
                                KeyUp="KeyUp_NewSetName"
                                Visibility="Collapsed"></TextBox>
                        <Label Name="NewSetTitle" IsEnabled="False">[Click to add a new set]</Label>
                    </StackPanel>
                </CheckBox>
            </StackPanel>
        </StackPanel>
    </Grid>
</UserControl>
